package com.opencfg.core.mode.reactor;

import java.util.concurrent.Callable;

/**
 * A sample Message Processor
 * The Message Processor holds a received message, and a SocketChannel to the message sender;
 * this socket enables replying back to the sender.
 * This sample processor sends a simple reply back to the message sender, regardless of the message's content.
 * <B>You should either extend or rewrite this Message Processor to work properly with the assignment definition.</B>
 */
class Request implements Callable<Response> {
	
    protected String _message;

    /**
     * Creates a new MessageProcessorTask
     * @param message the messge, as receieved from the sender
     * @param channel a channel which will be used to reply to the message sender
     */
    public Request(String message) {
        _message = message;
    }

	@Override
	public Response call() {
		//System.out.println("request :" + _message);
		
		return new Response(_message);
	}
}
